package com.adxon.filter;

import com.adxon.MsgException;
import com.adxon.Uri;
import com.adxon.data.Star;
import com.adxon.data.StarSet;
import com.adxon.data.Item;
import com.adxon.servlet.ServletBase;

import java.io.IOException;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class FollowerFilter extends FilterBase{
	public void doGet(HttpServletRequest req,HttpServletResponse resp,
			FilterChain chain)throws IOException,ServletException,
			InstantiationException,IllegalAccessException,
			MsgException{
		Uri r=new Uri(req);
		System.out.println("FollowerFilter: "+r.getPath());
		Item i=((Item)new Item().update(r.getPath())).extend();
		i.getAll(req);
		Star m=new Star();
		m.setId(i);
		req.setAttribute("m",new StarSet(m));
		ServletBase.setAttributes(req,"Follower");
		ServletBase.forward("follower.jsp",req,resp);
	}
}